import winreg as reg
import os,sys
from datetime import datetime


import pandas.io.clipboard as cb


current_directory = os.getcwd()
temp_file = "copy_log.txt"
log_path = os.path.join(current_directory,temp_file)

def write_to_log(log=""):
    if os.path.exists(log_path):
        print("file has")
        file = open(log_path,'a')# 追加写入datetime.now()
        file.write(str(datetime.now())+':'+log+'\n')
    else :
        print("file none")
        file = open(log_path,'w')
        file.write('hello\n')
    file.close()

def add_to_copy(res): 
    # 获取当前工作目录
    # cb.paste()  
    # cb.copy("复制内容")
    
    # print(cb.paste())
    cb.copy(res)
    # write_to_log(res)
    
    
    
    
if __name__ == "__main__":
    print(len(sys.argv))
    ars= "null"
    for i in range(1, len(sys.argv)):
        print('参数 %s 为：%s' % (i, sys.argv[i]))
        ars= sys.argv[i]
        # write_to_log(ars)
    # write_to_log(current_directory)
    add_to_copy(current_directory)